package com.gxwz.document.business.dao.impl;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.stereotype.Repository;

import com.gxwz.document.business.dao.IliteratureDao;
import com.gxwz.document.business.entity.Literature;
import com.gxwz.document.business.entity.User;
import com.gxwz.document.core.dao.impl.BaseDaoImpl;

@Repository("literatureDao")
public class LiteratureDaoImpl extends BaseDaoImpl<Literature> implements IliteratureDao {
	@Override
	public List<Literature> findAll() {
		String hql = "from Literature where 1=1";
		return this.find(hql);
	}
	
	@Override
	public List<Literature> findbyOrder(Literature literature, int index, int pageSize) {
		String hql = "from Literature where 1=1";
		if(!"".equals(literature.getLitId())){
			hql = "from Literature lit where lit.litId ="+literature.getLitId();		
		}

		System.out.println(hql);
		return this.findByPage(hql, index, pageSize);
	}
	
	
	
	
	
		}
